package org.boyan.modules.cgform.util;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

class n {
    private static final String a = "FECO#$N*CX";

    private static final Charset b = StandardCharsets.UTF_8;

    private static byte[] c = "FECO#$N*CX".getBytes(b);

    public static String a(String paramString) {
        byte[] arrayOfByte = paramString.getBytes(b);
        byte b;
        int i;
        for (b = 0, i = arrayOfByte.length; b < i; b++) {
            for (byte b1 : c)
                arrayOfByte[b] = (byte)(arrayOfByte[b] ^ b1);
        }
        return new String(arrayOfByte);
    }

    public static String b(String paramString) {
        byte[] arrayOfByte1 = paramString.getBytes(b);
        byte b;
        int i;
        for (b = 0, i = arrayOfByte1.length; b < i; b++) {
            for (byte b1 : c)
                arrayOfByte1[b] = (byte)(arrayOfByte1[b] ^ b1);
        }
        return new String(arrayOfByte1);
    }

    public static String c(String paramString) {
        MessageDigest messageDigest = null;
        try {
            messageDigest = MessageDigest.getInstance("MD5");
            messageDigest.reset();
            messageDigest.update(paramString.getBytes(StandardCharsets.UTF_8));
        } catch (NoSuchAlgorithmException ignored) {

        }
        assert messageDigest != null;
        byte[] arrayOfByte = messageDigest.digest();
        StringBuilder stringBuffer = new StringBuilder();
        for (byte value : arrayOfByte) {
            if (Integer.toHexString(0xFF & value).length() == 1) {
                stringBuffer.append("0").append(Integer.toHexString(0xFF & value));
            } else {
                stringBuffer.append(Integer.toHexString(0xFF & value));
            }
        }
        return stringBuffer.toString();
    }
}
